import Vue from "vue";
import Vuex from "vuex";
import store from "./store";

Vue.use(Vuex);
// 定义数据
var state = {
  list: [],
  Comming: [],
  Ranking: [],
  Search: [],
  Actress: [],
  Actess_2: [],
  url: "in_theaters"
};

// 定义方法
var mutations = {
  savaList(state, result) {
    state.list = result;
  },
  savaComming(state, result) {
    state.Comming = result;
  },
  savaRanking(state, result) {
    state.Ranking = result;
  },
  savaSearch(state, result) {
    state.Search = result;
  },
  savaActress(state, result) {
    state.Actress = result;
  },
  savaActress_2(state, result) {
    state.Actress_2 = result;
  },
  changeUrl(state, result) {
    state.url = result;
  }
};

export default new Vuex.Store({
  state,
  mutations
});
